import React, { useEffect, useState,memo,useCallback, useMemo } from 'react'
import Child from './Child'

export default function UseMemo() {
    const [n,setN] = useState(0)
    const [count,setCount] = useState(2)
    useEffect(()=>{
        setInterval(()=>{
            setN(Math.random())
            setCount(count+1)
        },2000)
    },[])
    const cb = useCallback(()=>{
    },[])
    // const count2=useMemo(()=>count*10,[count])
    return (
        <div>
            <div>{n}</div>
            <Child count={2} callBack={cb} />
        </div>
    )
}
